# **传递的是key=value的参数，并且会把该参数转换为字典类型
def func(**kwargs):
    print(kwargs)
    pass


func(a=1, b=2, c=3)
dict1 = {"username": "高家园"}
func(**dict1)  # **只能用于字典，会进行拆包，拆成username=高嘉银的形式


# 一个*会把参数转为元组的形式
def func1(*args):
    print(args)
    pass


a = [1, 2, 3]
print("--------")
print(*a)
func1(*a)  # 加一个*号会对列表进行拆包,func1里面又会对参数进行装包
func1(1, 2, 3)


def func2(a, b, *c, **d):
    print(a, b, c, d)
    pass


func2(1, 2)  # 1 2 () {}
func2(1, 2, 3, 4)  # 1 2 (3, 4) {}
func2(1, 2, c=3, d=4)  # 1 2 () {'c': 3, 'd': 4}
func2(1, 2, 3, c=3, d=4)  # 1 2 (3,) {'c': 3, 'd': 4}


def func3():
    return 1, 2


x = func3()
print(x)  # (1, 2)
x, y = func3()
print(x, y)  # 1 2

a = {"username": "高加银", "password": "123456"}
print(*a)  # 会获取所有的键
